package com.pshare.wx.tool;

import com.pshare.tools.PayPropertyUtils;

/**
 * 微信相关配置信息
 */
public class ConfigUtil {
	
	/**
	 * 服务号相关信息
	 */
	public static final String APP_ID = PayPropertyUtils.getProperty("WXPAY_APP_ID"); // 公众号身份的唯一标识
	public static final String APP_SECRET = PayPropertyUtils.getProperty("WXPAY_APP_SECRET"); // 公众号支付请求中用亍加密的密钥Key,可验证商户唯一身份
//	public static final String APP_KEY = PayPropertyUtils.getProperty("WXPAY_APP_KEY"); // 获取所需密钥Key
	public static final String MCH_ID = PayPropertyUtils.getProperty("WXPAY_MCH_ID"); // 商户号
	public final static String API_KEY = PayPropertyUtils.getProperty("WXPAY_API_KEY"); // API密钥
	public static final String CA_LOC = PayPropertyUtils.getProperty("WXPAY_CA_LOCATION");
	public static final String CERT_LOC = PayPropertyUtils.getProperty("WXPAY_CERT_LOCATION");  // 微信支付证书存放路径地址
//	public static final String PARTNER_PWD = PayPropertyUtils.getProperty("WXPAY_PARTNER_PWD");
	public final static String SIGN_TYPE = "MD5";// 签名加密方式

	// 微信支付统一接口的回调action
	public static final String NOTIFY_URL = PayPropertyUtils.getProperty("server.host+WXPAY_NOTIFYURL");
	// oauth2授权时回调action
//	public final static String REDIRECT_URI = PayPropertyUtils.getProperty("server.host+OAUTH2_BACKURL");
	/**
	 * 微信基础接口地址
	 */
	// 获取token接口(GET)
	public final static String TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=APPID&secret=APPSECRET";
	// oauth2授权接口(GET)
	public final static String OAUTH2_URL = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=APPID&secret=SECRET&code=CODE&grant_type=authorization_code";
	// 刷新access_token接口（GET）
	public final static String REFRESH_TOKEN_URL = "https://api.weixin.qq.com/sns/oauth2/refresh_token?appid=APPID&grant_type=refresh_token&refresh_token=REFRESH_TOKEN";
	// 菜单创建接口（POST）
	public final static String MENU_CREATE_URL = "https://api.weixin.qq.com/cgi-bin/menu/create?access_token=ACCESS_TOKEN";
	// 菜单查询（GET）
	public final static String MENU_GET_URL = "https://api.weixin.qq.com/cgi-bin/menu/get?access_token=ACCESS_TOKEN";
	// 菜单删除（GET）
	public final static String MENU_DELETE_URL = "https://api.weixin.qq.com/cgi-bin/menu/delete?access_token=ACCESS_TOKEN";
	/**
	 * 微信支付接口地址
	 */
	// 微信支付统一接口(POST)
	public final static String UNIFIED_ORDER_URL = "https://api.mch.weixin.qq.com/pay/unifiedorder";
	// 微信退款接口(POST)
	public final static String REFUND_URL = "https://api.mch.weixin.qq.com/secapi/pay/refund";
	// 订单查询接口(POST)
	public final static String CHECK_ORDER_URL = "https://api.mch.weixin.qq.com/pay/orderquery";
	// 关闭订单接口(POST)
	public final static String CLOSE_ORDER_URL = "https://api.mch.weixin.qq.com/pay/closeorder";
	// 退款查询接口(POST)
	public final static String CHECK_REFUND_URL = "https://api.mch.weixin.qq.com/pay/refundquery";
	// 对账单接口(POST)
	public final static String DOWNLOAD_BILL_URL = "https://api.mch.weixin.qq.com/pay/downloadbill";
	// 短链接转换接口(POST)
	public final static String SHORT_URL = "https://api.mch.weixin.qq.com/tools/shorturl";
	// 接口调用上报接口(POST)
	public final static String REPORT_URL = "https://api.mch.weixin.qq.com/payitil/report";
}
